import {
	ajax
} from "../utils/request.js"

// 订单列表
export function order_list(data) {
	return ajax({
		url: `api.php?m=Api&c=MyOrder&a=orderList`,
		method: 'POST',
		data
	})
}

//  订单详情
export function order_detail(order_id) {
	return ajax({
		url: `api.php?m=Api&c=MyOrder&a=orderDetail`,
		method: 'POST',
		data: {
			order_id
		}
	})
}

// 取消订单
export function cancel_order(order_id) {
	return ajax({
		url: `api.php?m=Api&c=MyOrder&a=cancelOrder`,
		method: 'POST',
		data: {
			order_id
		}
	})
}

// 订单付款
export function order_pay(order_id) {
	return ajax({
		url: `api.php?m=Api&c=MyOrder&a=noPayOrderPay`,
		method: 'POST',
		data: {
			order_id
		}
	})
}

// 合并付款
export function multi_order_pay(order_ids) {
	return ajax({
		url: `api.php?m=Api&c=MyOrder&a=multiOrderPay`,
		method: 'POST',
		data: {
			order_ids
		}
	})
}



// 确认收货
export function confirm_receipt(order_id) {
	return ajax({
		url: `api.php?m=Api&c=MyOrder&a=confirmReceipt`,
		method: 'POST',
		data: {
			order_id
		}
	})
}

// 订单物流
export function query_express(data) {
	return ajax({
		url: `api.php?m=Api&c=MyOrder&a=queryExpress`,
		method: 'POST',
		data
	})
}

// 订单提示数字
export function order_count() {
	return ajax({
		url: `api.php?m=Api&c=Tips&a=MyOrderCount`
	})
}

// 购物车提示数字
export function cart_count() {
	return ajax({
		url: `api.php?m=Api&c=Tips&a=cartCount`
	})
}